package org.springleaf.core.exception;

/**
 * 增删改查Exception
 * @author leaf
 */
public class CrudException extends Exception {

	private static final long serialVersionUID = 1L;

	/**
	 * 类型
	 */
	private CrudType type;

	/**
	 * 错误码
	 */
	private String code;

	public CrudException(String msg) {
		super(msg);
	}

	public CrudException(CrudType type, String msg) {
		super(msg);
		this.type = type;
	}

	public CrudException(CrudType type, String code, String msg) {
		super(msg);
		this.code = code;
		this.type = type;
	}

	/**
	 * 条件或着参数对象之类
	 */
	private Object params;

	public Object getParams() {
		return params;
	}

	public void setParams(Object params) {
		this.params = params;
	}

	public CrudType getType() {
		return type;
	}

	public void setType(CrudType type) {
		this.type = type;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
}
